{% extends 'base.html' %}

{% block header %}
<img style="vertical-align: middle;" src="{{ site.icon }}" alt="Downloads icon" /> Downloads
{% endblock header %}

{% block content %}
This area is for files that you can download to your computer!
<br />
To download them, click on the various links to be taken to the right pages!
</div>
</div>
</div>
<center>

{% if categories.has_other_pages %}
<b>
{% if categories.has_previous %}
<a href="?view={{ current.view }}&amp;{% include 'views.include.html' %}&amp;page={{ categories.previous_page_number }}">&lt;&lt;</a>
{% else %}
&lt;&lt;
{% endif %}

{% for page_number in categories.paginator.page_range %}
{% ifequal page_number categories.number %}
{{ page_number }}
{% else %}
<a href="?view={{ current.view }}&amp;{% include 'views.include.html' %}&amp;page={{ page_number }}">{{ page_number }}</a>
{% endifequal %}
{% ifequal page_number categories.paginator.num_pages %}
{% else %} 
:: 
{% endifequal %}
{% endfor %}

{% if categories.has_next %}
<a href="?view={{ current.view }}&amp;{% include 'views.include.html' %}&amp;page={{ categories.next_page_number }}">&gt;&gt;</a>
{% else %}
&gt;&gt;
{% endif %}
</b>
{% endif %}

<table>
<tr>

{% for category in categories.object_list %}
<td>
<div class="contentbox">
<div class="header"><a href="?category={{ category.name }}&amp;view={{ current.view }}&amp;{% include 'views.include.html' %}">{{ category.title }}</a></div>
<div class="green">
<table>
<tbody>
<tr>
<td>
<a href="?category={{ category.name }}&amp;view={{ current.view }}&amp;{% include 'views.include.html' %}"> <img src="{{ category.icon }}" alt="{{ category.title }} icon"  width="64" align="middle"  /></a>
</td>
<td style="vertical-align: middle">

{% for object in category.objects|slice:":3" %} 
<b>
<a href="?category={{ category.name }}&amp;object={{ object.name }}&amp;view={{ current.view }}&amp;{% include 'views.include.html' %}" onmouseover="Tip('&lt;img src={{ object.thumbnail }} /&lt;{{ object.title }}', BORDERCOLOR, 'gray')" >{{ object.title }}</a>
</b>
<br />
{% endfor %}

<br />
<a href="?category={{ category.name }}&amp;view={{ current.view }}&amp;{% include 'views.include.html' %}&amp;page={{ current.page }}"><b>View the rest!</b></a>
</td></tr></tbody>
</table></div>
</div>
</td>
{% if category.end_of_row %}
{% if category.end %}
</tr>
{% else %}
</tr>
<tr>
{% endif %}
{% else %}
{% endif %}
 {% endfor %}
 
</table>
</center>
{% endblock content %}
